#ifndef SYMBOL_VIEW_H
#define SYMBOL_VIEW_H

#include <QWidget>

QT_BEGIN_NAMESPACE
class QObject;
class QListView;
class QLineEdit;
class QSortFilterProxyModel;
class QButtonGroup;
class QPushButton;
class QModelIndex;
QT_END_NAMESPACE

class EditSymbolView;
class SymbolModel;

class SymbolView : public QWidget
{
    Q_OBJECT
    
public:
    
    explicit SymbolView( QWidget * parent = 0 );
    
    void setSymbolModel( SymbolModel * model );
    
    void setCurrent( const QModelIndex & model_index );
    
signals:

    void symbolIndexChanged( const QModelIndex & model_index );
    
private slots:
    
    void buttonClicked( int buttonId );
    
    void currentChanged( const QModelIndex & current, const QModelIndex & previous );
    
private:

    enum ButtonIndex
    {
        ADD_BUTTON = 1,
        DELETE_BUTTON,
    };

    QLayout * createSymbolList();
    
    QListView
        * listView;
    QLineEdit
        * searchLineEdit;
    EditSymbolView
        * editSymbolView;
    SymbolModel
        * symbolModel;
    QSortFilterProxyModel
        * filteredModel;
    QButtonGroup
        * listEditButtonGroup;
    QPushButton
        *addSymbolButton,
        *deleteSymbolButton;
    
};
#endif